package com.aaa.mapper.front;

import com.aaa.entity.Goods;
import com.aaa.entity.ShoppingCartDetail;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface ShoppingCartDetailMapper {
    /**
     * 根据购物车编号查询购物车明细
     * @param shoppingCartId
    * @return
     */
    List<ShoppingCartDetail> findShoppingCartDetail(Integer shoppingCartId);

    /**
     * 在购物车明细中添加商品
     * @param shoppingCartDetail
     * @return
     */
    int insertGoods(ShoppingCartDetail shoppingCartDetail);

    /**
     * 更新商品数量
     * @param map
     * @return
     */
    int updateGoodsNum(Map<String, Object> map);

    /**
     * 根据购物车编号和商品编号查询购物车明细
     * @param map
     * @return
     */
    ShoppingCartDetail findShoppingCartDetailByGoodsIdAndShoppingCartId(Map<String, Object> map);


    /**
     * 根据购物车编号和商品编号删除商品
     * @param map
     * @return
     */
    int deleteGoodsDetail(Map<String, Object> map);
}
